#pragma once
#include "Globals.h"
#include "GraphicsHandler.h"
#include "MapReader.h"
#include "Laser.h"
#include "DirectInput.h"
#include "Sound.h"
#include "Splash.h"

class GameHandler
{
private:
	GameHandler();
	DrawList	O_List;
	SpriteList	S_List;
	SoundObject	Sounds;
	Laser GameLaser;

	MapReader Map;
	//=====For Selecting
	//int NowCoord.X, NowCoord.Y;
	int MoveMade;
	Pair NowCoord;

	//=====INIT MENU
	void InitMenuObjects();
	void AddButton (Pair Pt, int Show, int Switch, char* Text);
	void AddPanel  (Pair Pt, int Show, char* Text);
	void AddSplash (Pair Pt, int Show);

	//=====MAP STUFF
	void BuildMap(LPCSTR FileName);
	void SetDrawList();

public:
	//=====INITIALIZE
	void Init(HWND, HINSTANCE, bool Open);
	
	//=====INPUT
	void NextObject();
	void BackObject();
	void NextPlayer();
	void Move(int Dir);
	void Rotate(int Dir);
	void ButtonClick();
	void Input();
	

	//=====UPDATE
	bool Update(HWND);  //Returns false if the game is over

	//=====RENDER
	void Render();

	inline static GameHandler* Into()			
	{static GameHandler GH;return &GH;};



};